{
	"info": {
		"_postman_id": "d7427d3f-e1b7-4ace-a1db-3b9276256956",
		"name": "Протокол 1.3 УЗИ",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "48020210",
		"_collection_link": "https://nst-sid-6186244.postman.co/workspace/nst-sid's-Workspace~d2a1dc8f-cae0-4166-807b-dc131f8f29a6/collection/48020210-d7427d3f-e1b7-4ace-a1db-3b9276256956?action=share&source=collection_link&creator=48020210"
	},
	"item": [
		{
			"name": "1. Создание направления на прохождение УЗИ",
			"item": [
				{
					"name": "Предварительные условия - авторизация врача",
					"item": [
						{
							"name": "Получить новый токен и достать врача из токена (PractitionerId)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"const jwt = pm.request.auth?.oauth2?.get(\"accessToken\") || pm.request.auth?.bearer?.get(\"token\") || null;\r",
											"console.log(jwt);\r",
											"if (jwt) {\r",
											"    let payload = jwt.split('.')[1];\r",
											"    payload = payload.replace(/-/g, '+').replace(/_/g, '/');\r",
											"    while (payload.length % 4) payload += '=';\r",
											"    let decoded = JSON.parse(atob(payload));\r",
											"    console.log(decoded)\r",
											"    let practitionerId = decoded.practitioner_id || decoded.practitionerId || decoded[\"practitioner_id\"];\r",
											"    let organizationId = decoded.organization_id || decoded.organizationId || decoded[\"organization_id\"];\r",
											"    if (practitionerId) pm.environment.set(\"PractitionerId\", practitionerId);\r",
											"    if (organizationId) pm.environment.set(\"OrganizationId\", organizationId);\r",
											"} else {\r",
											"    console.log(\"JWT токен не найден в переменных коллекции\");\r",
											"}"
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"protocolProfileBehavior": {
								"disableBodyPruning": true
							},
							"request": {
								"method": "GET",
								"header": [
									{
										"key": "X-Fhir-By-Version",
										"value": "0.3.4934",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": ""
								},
								"url": {
									"raw": "https://postman-echo.com/get",
									"protocol": "https",
									"host": [
										"postman-echo",
										"com"
									],
									"path": [
										"get"
									]
								}
							},
							"response": []
						},
						{
							"name": "Достать PractitionerRole врача (PractitionerRole)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
											"\r",
											"pm.environment.set(\"PractitionerRole\", practitionerRole);\r",
											"console.log(practitionerRole)\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId}}",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"PractitionerRole"
									],
									"query": [
										{
											"key": "practitioner",
											"value": "{{PractitionerId}}"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Достать структурное подразделение врача (LocationId)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"let json = pm.response.json();\r",
											"let locationValue = null;\r",
											"\r",
											"if (Array.isArray(json.entry)) {\r",
											"    for (let entry of json.entry) {\r",
											"        if (\r",
											"            entry.resource &&\r",
											"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
											"            Array.isArray(entry.resource.location) &&\r",
											"            entry.resource.location.length > 0\r",
											"        ) {\r",
											"            // Берём reference первого location и извлекаем только UUID\r",
											"            let ref = entry.resource.location[0].reference;\r",
											"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
											"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
											"            }\r",
											"            break;\r",
											"        }\r",
											"    }\r",
											"}\r",
											"\r",
											"if (locationValue) {\r",
											"    pm.environment.set(\"LocationId\", locationValue);\r",
											"    console.log(\"location сохранён:\", locationValue);\r",
											"} else {\r",
											"    console.log(\"location не найден\");\r",
											"}\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole}}",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"PractitionerRole"
									],
									"query": [
										{
											"key": "_id",
											"value": "{{PractitionerRole}}"
										}
									]
								}
							},
							"response": []
						}
					]
				},
				{
					"name": "Поиск пациента по идентификатору (patientId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
									"\r",
									"pm.environment.set(\"patientId\", patientId);\r",
									"console.log(patientId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551227A009PB2",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient"
							],
							"query": [
								{
									"key": "identifier",
									"value": "7551227A009PB2"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод импорта пакета медицинской информации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleUltrasoundSR\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3987\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-11-20T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleUS1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionBundleUS1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/ExampleEncounterBundleUS1\"\r\n                },\r\n                \"date\": \"2025-11-20T11:30:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisBundleUS1\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ServiceRequest/ExampleServiceRequestBundleUS1\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Encounter/ExampleEncounterBundleUS1\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551227A009PB2\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 21.08.2021\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2022-08-21\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"version\": \"1.3\",\r\n                                                    \"code\": \"Minsk\",\r\n                                                    \"display\": \"Минск\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"version\": \"1.10\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP1233212\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375123456789\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.2\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.1201\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/ExampleEncounterBundleUS1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterBundleUS1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfVisit\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfVisit\",\r\n                                    \"code\": \"primary\",\r\n                                    \"display\": \"первичное обращение\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfService\",\r\n                                    \"code\": \"free\",\r\n                                    \"display\": \"Бесплатные услуги\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1234/6\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\",\r\n                                \"display\": \"амбулаторные\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\",\r\n                            \"display\": \"Плановая медицинская помощь\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"primary\",\r\n                                \"display\": \"Первичная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-11-20T11:30:00Z\",\r\n                    \"end\": \"2025-11-20T11:50:00Z\"\r\n                },\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisBundleUS1\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisBundleUS1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisBundleUS1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\",\r\n                                    \"display\": \"Предварительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/CourseOfDisease\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/CourseOfDisease\",\r\n                                    \"code\": \"acute\",\r\n                                    \"display\": \"Острое течение заболевания\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-11-20\"\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"N23\"\r\n                        }\r\n                    ],\r\n                    \"text\": \"N23 – Почечная колика неуточненная\"\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-11-20\",\r\n                \"recordedDate\": \"2025-11-20\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Почечная колика неуточненная?\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ServiceRequest/ExampleServiceRequestBundleUS1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ServiceRequest\",\r\n                \"id\": \"ExampleServiceRequestBundleUS1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ServiceRequestUltrasound\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SpecialtyCode\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ServiceSpecialtyBy\",\r\n                                    \"code\": \"C056\",\r\n                                    \"display\": \"Ультразвуковая диагностика\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequestFromOrganization\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"A0133\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"directive\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"03/1\",\r\n                                \"display\": \"Амбулаторно-поликлиническая диагностика для взрослого населения\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": \"routine\",\r\n                \"code\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSHealthcareServiceTypeBUltrasound\",\r\n                                \"code\": \"B01-049-001.vs\",\r\n                                \"display\": \"Прием (осмотр, консультация) врача ультразвуковой диагностики первичный\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"orderDetail\": [\r\n                    {\r\n                        \"parameter\": [\r\n                            {\r\n                                \"code\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/UltrasoundTypes\",\r\n                                            \"code\": \"A04-28-001\",\r\n                                            \"display\": \"УЗИ почек\"\r\n                                        }\r\n                                    ]\r\n                                },\r\n                                \"valueString\": \"Ограничений для проведения исследования нет\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/ExampleEncounterBundleUS1\"\r\n                },\r\n                \"occurrenceDateTime\": \"2025-11-25T11:30:00Z\",\r\n                \"authoredOn\": \"2025-11-20T11:30:00Z\",\r\n                \"requester\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                },\r\n                \"performer\": [\r\n                    {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"Location/{{LocationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"concept\": {\r\n                            \"text\": \"Для оценки состояния почек и исключения патологии\"\r\n                        },\r\n                        \"reference\": {\r\n                            \"reference\": \"Condition/ExampleDiagnosisBundleUS1\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patientInstruction\": [\r\n                    {\r\n                        \"instructionMarkdown\": \"Воздержаться от приема пищи за 6-8 часов до проведения УЗИ, исключить из рациона жирные и жареные блюда\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск направления на УЗИ",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/ServiceRequest?_profile=https://fhir.by/StructureDefinition/ServiceRequestUltrasound&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"ServiceRequest"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/ServiceRequestUltrasound"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение сводной информации о пациенте",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"$everything"
							],
							"query": [
								{
									"key": "start",
									"value": "2025-10"
								},
								{
									"key": "end",
									"value": "2025-12"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "2. Создание ультразвукового исследования (амбулаторно-поликлиническая диагностика)",
			"item": [
				{
					"name": "Предварительные условия - авторизация врача ультразвуковой диагностики",
					"item": [
						{
							"name": "Получить новый токен и достать врача УЗИ (PractitionerId_diagnostics)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"const jwt = pm.request.auth?.oauth2?.get(\"accessToken\") || pm.request.auth?.bearer?.get(\"token\") || null;\r",
											"console.log(jwt);\r",
											"if (jwt) {\r",
											"    let payload = jwt.split('.')[1];\r",
											"    payload = payload.replace(/-/g, '+').replace(/_/g, '/');\r",
											"    while (payload.length % 4) payload += '=';\r",
											"    let decoded = JSON.parse(atob(payload));\r",
											"    console.log(decoded)\r",
											"    let practitionerId = decoded.practitioner_id || decoded.practitionerId || decoded[\"practitioner_id\"];\r",
											"    let organizationId = decoded.organization_id || decoded.organizationId || decoded[\"organization_id\"];\r",
											"    if (practitionerId) pm.environment.set(\"PractitionerId_diagnostics\", practitionerId);\r",
											"    if (organizationId) pm.environment.set(\"OrganizationId\", organizationId);\r",
											"} else {\r",
											"    console.log(\"JWT токен не найден в переменных коллекции\");\r",
											"}"
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"protocolProfileBehavior": {
								"disableBodyPruning": true
							},
							"request": {
								"method": "GET",
								"header": [
									{
										"key": "X-Fhir-By-Version",
										"value": "0.3.4934",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": ""
								},
								"url": {
									"raw": "https://postman-echo.com/get",
									"protocol": "https",
									"host": [
										"postman-echo",
										"com"
									],
									"path": [
										"get"
									]
								}
							},
							"response": []
						},
						{
							"name": "Достать PractitionerRole врача ультразвуковой диагностики (PractitionerRole_diagnostics)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
											"\r",
											"pm.environment.set(\"PractitionerRole_diagnostics\", practitionerRole);\r",
											"console.log(practitionerRole)\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								},
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId_diagnostics}}&position-type=ultrasound-diagnostics-doctor",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"PractitionerRole"
									],
									"query": [
										{
											"key": "practitioner",
											"value": "{{PractitionerId_diagnostics}}"
										},
										{
											"key": "position-type",
											"value": "ultrasound-diagnostics-doctor"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Достать структурное подразделение врача (LocationId_diagnostics)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"let json = pm.response.json();\r",
											"let locationValue = null;\r",
											"\r",
											"if (Array.isArray(json.entry)) {\r",
											"    for (let entry of json.entry) {\r",
											"        if (\r",
											"            entry.resource &&\r",
											"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
											"            Array.isArray(entry.resource.location) &&\r",
											"            entry.resource.location.length > 0\r",
											"        ) {\r",
											"            // Берём reference первого location и извлекаем только UUID\r",
											"            let ref = entry.resource.location[0].reference;\r",
											"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
											"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
											"            }\r",
											"            break;\r",
											"        }\r",
											"    }\r",
											"}\r",
											"\r",
											"if (locationValue) {\r",
											"    pm.environment.set(\"LocationId_diagnostics\", locationValue);\r",
											"    console.log(\"location сохранён:\", locationValue);\r",
											"} else {\r",
											"    console.log(\"location не найден\");\r",
											"}\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole_diagnostics}}",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"PractitionerRole"
									],
									"query": [
										{
											"key": "_id",
											"value": "{{PractitionerRole_diagnostics}}"
										}
									]
								}
							},
							"response": []
						}
					]
				},
				{
					"name": "Поиск пациента по идентификатору (patientId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
									"\r",
									"pm.environment.set(\"patientId\", patientId);\r",
									"console.log(patientId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551227A009PB2",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient"
							],
							"query": [
								{
									"key": "identifier",
									"value": "7551227A009PB2"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск направления на УЗИ (UltrasoundServiceRequestId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let servicerequestId = jsonData.entry.find(obj => obj.resource.resourceType === \"ServiceRequest\").resource.id;\r",
									"\r",
									"pm.environment.set(\"UltrasoundServiceRequestId\", servicerequestId);\r",
									"console.log(servicerequestId)"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/ServiceRequest?_profile=https://fhir.by/StructureDefinition/ServiceRequestUltrasound&_sort=-_lastUpdated&status=active",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"ServiceRequest"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/ServiceRequestUltrasound"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "status",
									"value": "active"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод поиска диагноза (ConditionId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r",
									"\r",
									"pm.environment.set(\"ConditionId\", conditionId);\r",
									"console.log(conditionId)"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&patient={{patientId}}&_sort=-_lastUpdated&code=N23",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"Condition"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "code",
									"value": "N23"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод импорта пакета медицинской информации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleUltrasoundObsDiagR\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3987\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-11-24T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionUltrasoundObsDiagR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionUltrasoundObsDiagR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/ExampleEncounterBundleObsDR\"\r\n                },\r\n                \"date\": \"2025-11-24T11:30:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId_diagnostics}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Observation/ExampleUltrasoundObsDR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"DiagnosticReport/ExampleDiagnosticReportObsDR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Encounter/ExampleEncounterBundleObsDR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551227A009PB2\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 21.08.2021\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2022-08-21\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"version\": \"1.3\",\r\n                                                    \"code\": \"Minsk\",\r\n                                                    \"display\": \"Минск\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"version\": \"1.10\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP1233212\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375123456789\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.2\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.1201\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/ExampleEncounterBundleObsDR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterBundleObsDR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfVisit\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfVisit\",\r\n                                    \"code\": \"primary\",\r\n                                    \"display\": \"первичное обращение\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfService\",\r\n                                    \"code\": \"free\",\r\n                                    \"display\": \"Бесплатные услуги\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1234/7\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\",\r\n                                \"display\": \"амбулаторные\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\",\r\n                            \"display\": \"Плановая медицинская помощь\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"primary\",\r\n                                \"display\": \"Первичная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_diagnostics}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-11-24T11:30:00Z\",\r\n                    \"end\": \"2025-11-24T11:30:00Z\"\r\n                },\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/{{ConditionId}}\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Observation/ExampleUltrasoundObsDR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Observation\",\r\n                \"id\": \"ExampleUltrasoundObsDR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ObservationUltrasound\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Location/{{LocationId_diagnostics}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"KID2025-001\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"basedOn\": [\r\n                    {\r\n                        \"reference\": \"ServiceRequest/{{UltrasoundServiceRequestId}}\"\r\n                    }\r\n                ],\r\n                \"status\": \"final\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"03/1\",\r\n                                \"display\": \"Амбулаторно-поликлиническая диагностика для взрослого населения\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/UltrasoundTypes\",\r\n                            \"code\": \"A04-28-001\",\r\n                            \"display\": \"УЗИ почек\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/ExampleEncounterBundleObsDR\"\r\n                },\r\n                \"effectivePeriod\": {\r\n                    \"start\": \"2025-11-24T12:05:00Z\",\r\n                    \"end\": \"2025-11-24T12:15:00Z\"\r\n                },\r\n                \"issued\": \"2025-11-24T12:20:00Z\",\r\n                \"performer\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PerformerTypeObservation\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/PerformerType\",\r\n                                            \"code\": \"organization-per\",\r\n                                            \"display\": \"организация\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PerformerTypeObservation\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/PerformerType\",\r\n                                            \"code\": \"practitionerRole-per\",\r\n                                            \"display\": \"роль медработника\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRole_diagnostics}}\"\r\n                    }\r\n                ],\r\n                \"component\": [\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-location\",\r\n                                    \"display\": \"Расположение правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Обычное\"\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-borders\",\r\n                                    \"display\": \"Контуры правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Ровные, четкие\"\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-length\",\r\n                                    \"display\": \"Длина правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 105,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-thickness\",\r\n                                    \"display\": \"Толщина правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 45,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-width\",\r\n                                    \"display\": \"Ширина правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 52,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-parenchyma-width\",\r\n                                    \"display\": \"Толщина паренхимы правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 18,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-parenchyma-echogenicity\",\r\n                                    \"display\": \"Эхогенность паренхимы правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltraSoundQualitativeParameters\",\r\n                                    \"code\": \"normal\",\r\n                                    \"display\": \"Норма\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-parenchyma-structure\",\r\n                                    \"display\": \"Структура паренхимы правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltraSoundQualitativeParameters\",\r\n                                    \"code\": \"homogeneous\",\r\n                                    \"display\": \"Однородная\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-pelvicalyceal-system\",\r\n                                    \"display\": \"Чашечно-лоханочная система правой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Не расширена\"\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-lesions\",\r\n                                    \"display\": \"Очаговые образования (правая почка)\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-R-stones\",\r\n                                    \"display\": \"Конкременты (правая почка)\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueBoolean\": true\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-location\",\r\n                                    \"display\": \"Расположение левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Обычное\"\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-borders\",\r\n                                    \"display\": \"Контуры левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Ровные, четкие\"\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-length\",\r\n                                    \"display\": \"Длина левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 108,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-width\",\r\n                                    \"display\": \"Толщина левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 42,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-width\",\r\n                                    \"display\": \"Ширина левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 49,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-parenchyma-width\",\r\n                                    \"display\": \"Толщина паренхимы левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueQuantity\": {\r\n                            \"value\": 22,\r\n                            \"unit\": \"мм\",\r\n                            \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\",\r\n                            \"code\": \"mm\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-parenchyma-echogenicity\",\r\n                                    \"display\": \"Эхогенность паренхимы левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltraSoundQualitativeParameters\",\r\n                                    \"code\": \"normal\",\r\n                                    \"display\": \"Норма\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-parenchyma-structure\",\r\n                                    \"display\": \"Структура паренхимы левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltraSoundQualitativeParameters\",\r\n                                    \"code\": \"homogeneous\",\r\n                                    \"display\": \"Однородная\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-pelvicalyceal-system\",\r\n                                    \"display\": \"Чашечно-лоханочная система левой почки\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Не расширена\"\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-lesions\",\r\n                                    \"display\": \"Очаговые образования (левая почка)\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"kidney-L-stones\",\r\n                                    \"display\": \"Конкременты (левая почка)\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"code\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/UltrasoundParametres\",\r\n                                    \"code\": \"additional-info\",\r\n                                    \"display\": \"Дополнительная информация\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"valueString\": \"Обнаружен единичный конкремент чашечно-лоханочной системы правой почки до 6 мм\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"DiagnosticReport/ExampleDiagnosticReportObsDR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"DiagnosticReport\",\r\n                \"id\": \"ExampleDiagnosticReportObsDR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/UltrasoundDiagnosticReport\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Location/{{LocationId_diagnostics}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RecomendationForFuncDiagConclusion\",\r\n                        \"valueString\": \"Рекомендовано наблюдение уролога, контрольное УЗИ в динамике\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExaminationPriority\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ExaminationPriority\",\r\n                                    \"code\": \"routine\",\r\n                                    \"display\": \"планово\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"KID2025-001\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"basedOn\": [\r\n                    {\r\n                        \"reference\": \"ServiceRequest/{{UltrasoundServiceRequestId}}\"\r\n                    }\r\n                ],\r\n                \"status\": \"final\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"03/1\",\r\n                                \"display\": \"Амбулаторно-поликлиническая диагностика для взрослого населения\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/UltrasoundTypes\",\r\n                            \"code\": \"A04-28-001\",\r\n                            \"display\": \"УЗИ почек\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/ExampleEncounterBundleObsDR\"\r\n                },\r\n                \"effectivePeriod\": {\r\n                    \"start\": \"2025-11-24T12:05:00Z\",\r\n                    \"end\": \"2025-11-24T12:15:00Z\"\r\n                },\r\n                \"issued\": \"2025-11-24T12:30:00Z\",\r\n                \"performer\": [\r\n                    {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                ],\r\n                \"resultsInterpreter\": [\r\n                    {\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRole_diagnostics}}\"\r\n                    }\r\n                ],\r\n                \"result\": [\r\n                    {\r\n                        \"reference\": \"Observation/ExampleUltrasoundObsDR\"\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Исследование выполнено первично по поводу эпизода почечной колики. Визуализация почек удовлетворительная\"\r\n                    }\r\n                ],\r\n                \"conclusion\": \"УЗИ-признаки нефролитиаза справа: единичный конкремент чашечно-лоханочной системы правой почки до 6 мм\"\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск исследования пациента по УЗИ",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Observation?_profile=https://fhir.by/StructureDefinition/ObservationUltrasound&_sort=-_lastUpdated&patient={{patientId}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"Observation"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/ObservationUltrasound"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск заключения по УЗИ",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DiagnosticReport?_profile=https://fhir.by/StructureDefinition/UltrasoundDiagnosticReport&patient={{patientId}}&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"DiagnosticReport"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/UltrasoundDiagnosticReport"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение сводной информации о пациенте",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"$everything"
							],
							"query": [
								{
									"key": "start",
									"value": "2025-10"
								},
								{
									"key": "end",
									"value": "2025-12"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "3. Создание ультразвукового исследования (стационарная диагностика)",
			"item": [
				{
					"name": "3.1 Создание направления на госпитализацию",
					"item": [
						{
							"name": "Предварительные условия - авторизация врача",
							"item": [
								{
									"name": "Получить новый токен и достать врача из токена (PractitionerId)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"const jwt = pm.request.auth?.oauth2?.get(\"accessToken\") || pm.request.auth?.bearer?.get(\"token\") || null;\r",
													"console.log(jwt);\r",
													"if (jwt) {\r",
													"    let payload = jwt.split('.')[1];\r",
													"    payload = payload.replace(/-/g, '+').replace(/_/g, '/');\r",
													"    while (payload.length % 4) payload += '=';\r",
													"    let decoded = JSON.parse(atob(payload));\r",
													"    console.log(decoded)\r",
													"    let practitionerId = decoded.practitioner_id || decoded.practitionerId || decoded[\"practitioner_id\"];\r",
													"    let organizationId = decoded.organization_id || decoded.organizationId || decoded[\"organization_id\"];\r",
													"    if (practitionerId) pm.environment.set(\"PractitionerId\", practitionerId);\r",
													"    if (organizationId) pm.environment.set(\"OrganizationId\", organizationId);\r",
													"} else {\r",
													"    console.log(\"JWT токен не найден в переменных коллекции\");\r",
													"}"
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"protocolProfileBehavior": {
										"disableBodyPruning": true
									},
									"request": {
										"method": "GET",
										"header": [
											{
												"key": "X-Fhir-By-Version",
												"value": "0.3.4934",
												"type": "text"
											}
										],
										"body": {
											"mode": "raw",
											"raw": ""
										},
										"url": {
											"raw": "https://postman-echo.com/get",
											"protocol": "https",
											"host": [
												"postman-echo",
												"com"
											],
											"path": [
												"get"
											]
										}
									},
									"response": []
								},
								{
									"name": "Достать PractitionerRole врача (PractitionerRole)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"var jsonData = pm.response.json();\r",
													"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
													"\r",
													"pm.environment.set(\"PractitionerRole\", practitionerRole);\r",
													"console.log(practitionerRole)\r",
													""
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId}}",
											"protocol": "https",
											"host": [
												"pp",
												"cisz",
												"by"
											],
											"path": [
												"api",
												"fhir",
												"PractitionerRole"
											],
											"query": [
												{
													"key": "practitioner",
													"value": "{{PractitionerId}}"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "Достать структурное подразделение врача (LocationId)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"let json = pm.response.json();\r",
													"let locationValue = null;\r",
													"\r",
													"if (Array.isArray(json.entry)) {\r",
													"    for (let entry of json.entry) {\r",
													"        if (\r",
													"            entry.resource &&\r",
													"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
													"            Array.isArray(entry.resource.location) &&\r",
													"            entry.resource.location.length > 0\r",
													"        ) {\r",
													"            // Берём reference первого location и извлекаем только UUID\r",
													"            let ref = entry.resource.location[0].reference;\r",
													"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
													"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
													"            }\r",
													"            break;\r",
													"        }\r",
													"    }\r",
													"}\r",
													"\r",
													"if (locationValue) {\r",
													"    pm.environment.set(\"LocationId\", locationValue);\r",
													"    console.log(\"location сохранён:\", locationValue);\r",
													"} else {\r",
													"    console.log(\"location не найден\");\r",
													"}\r",
													""
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole}}",
											"protocol": "https",
											"host": [
												"pp",
												"cisz",
												"by"
											],
											"path": [
												"api",
												"fhir",
												"PractitionerRole"
											],
											"query": [
												{
													"key": "_id",
													"value": "{{PractitionerRole}}"
												}
											]
										}
									},
									"response": []
								}
							]
						},
						{
							"name": "Поиск пациента по идентификатору (patientId)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
											"\r",
											"pm.environment.set(\"patientId\", patientId);\r",
											"console.log(patientId)\r",
											""
										],
										"type": "text/javascript",
										"packages": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551227A009PB2",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient"
									],
									"query": [
										{
											"key": "identifier",
											"value": "7551227A009PB2"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Создание направления на госпитализацию",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
											"    pm.response.to.have.status(202);\r",
											"});\r",
											"\r",
											"var jsonData = pm.response.json();\r",
											"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
											"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
											"\r",
											"console.log(statusReference.valueReference.reference);\r",
											"\r",
											"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
											"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								},
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "POST",
								"header": [
									{
										"key": "X-Fhir-By-Version",
										"value": "active",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleUltrasound3\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3987\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-11-24T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionUltrasound3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionUltrasound3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-11-24T11:30:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ServiceRequest/ExampleServiceRequestHospitalisationInjury\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisPreliminaryTest\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisPreliminaryTest\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551227A009PB2\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 21.08.2021\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2022-08-21\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"version\": \"1.3\",\r\n                                                    \"code\": \"Minsk\",\r\n                                                    \"display\": \"Минск\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"version\": \"1.10\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP1233212\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375123456789\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.2\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.1201\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ServiceRequest/ExampleServiceRequestHospitalisationInjury\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ServiceRequest\",\r\n                \"id\": \"ExampleServiceRequestHospitalisationInjury\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ServiceRequestHospitalisation\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SpecialtyCode\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ServiceSpecialtyBy\",\r\n                                    \"code\": \"C061\",\r\n                                    \"display\": \"Хирургия\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequestFromOrganization\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"12345\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"directive\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"02/2\",\r\n                                \"display\": \"Стационарная медицинская помощь взрослому населению\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": \"asap\",\r\n                \"code\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HospitalisationGoals\",\r\n                                \"code\": \"surgery\",\r\n                                \"display\": \"выполнение хирургического вмешательства\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/EncounterTest\"\r\n                },\r\n                \"authoredOn\": \"2025-11-24T12:00:00Z\",\r\n                \"requester\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                },\r\n                \"performer\": [\r\n                    {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"Condition/AcuteAppendicitisPreliminaryTest\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Направляется на госпитализацию с предварительным диагнозом острый аппендицит. Пациент жалуется на сильную боль в правом нижнем квадранте живота, тошноту, рвоту.\\n               Боль усиливается при чихании, резких движениях\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"EncounterTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterConclusion\",\r\n                        \"valueString\": \"Выдано направление на госпитализацию\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfVisit\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfVisit\",\r\n                                    \"code\": \"primary\",\r\n                                    \"display\": \"первичное обращение\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfService\",\r\n                                    \"code\": \"free\",\r\n                                    \"display\": \"Бесплатные услуги\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\",\r\n                                \"display\": \"амбулаторные\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\",\r\n                            \"display\": \"Плановая медицинская помощь\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\",\r\n                                \"display\": \"Специализированная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-11-24T11:12:21Z\",\r\n                    \"end\": \"2025-11-24T11:25:21Z\"\r\n                },\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/EncounterReasons\",\r\n                                        \"code\": \"consult\",\r\n                                        \"display\": \"врачебная консультация\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisPreliminaryTest\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/AcuteAppendicitisPreliminaryTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"AcuteAppendicitisPreliminaryTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-11-24T10:12:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/CourseOfDisease\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/CourseOfDisease\",\r\n                                    \"code\": \"acute\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"K35\",\r\n                            \"display\": \"K35 - Острый аппендицит\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-11-24\",\r\n                \"recordedDate\": \"2025-11-24\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Предварительный диагноз О. аппендицит ?\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Bundle",
										"$import"
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод получения статуса импорта пакета медицинской информации",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Bundle",
										"{{bundleId}}",
										"$status"
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск направления на госпитализацию",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/ServiceRequest?_profile=https://fhir.by/StructureDefinition/ServiceRequestHospitalisation&_sort=-_lastUpdated&status=active",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"ServiceRequest"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/ServiceRequestHospitalisation"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "status",
											"value": "active"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Получение сводной информации о пациенте",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"$everything"
									],
									"query": [
										{
											"key": "start",
											"value": "2025-10"
										},
										{
											"key": "end",
											"value": "2025-12"
										}
									]
								}
							},
							"response": []
						}
					]
				},
				{
					"name": "3.2 Создание случая госпитализации",
					"item": [
						{
							"name": "Предварительные условия - авторизация врача приемного отделения",
							"item": [
								{
									"name": "Получить новый токен и достать врача приемного отделения из токена (PractitionerId_EmergencyRoom)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"const jwt = pm.request.auth?.oauth2?.get(\"accessToken\") || pm.request.auth?.bearer?.get(\"token\") || null;\r",
													"console.log(jwt);\r",
													"if (jwt) {\r",
													"    let payload = jwt.split('.')[1];\r",
													"    payload = payload.replace(/-/g, '+').replace(/_/g, '/');\r",
													"    while (payload.length % 4) payload += '=';\r",
													"    let decoded = JSON.parse(atob(payload));\r",
													"    console.log(decoded)\r",
													"    let practitionerId = decoded.practitioner_id || decoded.practitionerId || decoded[\"practitioner_id\"];\r",
													"    let organizationId = decoded.organization_id || decoded.organizationId || decoded[\"organization_id\"];\r",
													"    if (practitionerId) pm.environment.set(\"PractitionerId_EmergencyRoom\", practitionerId);\r",
													"    if (organizationId) pm.environment.set(\"OrganizationId\", organizationId);\r",
													"} else {\r",
													"    console.log(\"JWT токен не найден в переменных коллекции\");\r",
													"}"
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"protocolProfileBehavior": {
										"disableBodyPruning": true
									},
									"request": {
										"method": "GET",
										"header": [
											{
												"key": "X-Fhir-By-Version",
												"value": "0.3.4934",
												"type": "text"
											}
										],
										"body": {
											"mode": "raw",
											"raw": ""
										},
										"url": {
											"raw": "https://postman-echo.com/get",
											"protocol": "https",
											"host": [
												"postman-echo",
												"com"
											],
											"path": [
												"get"
											]
										}
									},
									"response": []
								},
								{
									"name": "Достать PractitionerRole врача приемного отделения (PractitionerRole_EmergencyRoom)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"var jsonData = pm.response.json();\r",
													"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
													"\r",
													"pm.environment.set(\"PractitionerRole_EmergencyRoom\", practitionerRole);\r",
													"console.log(practitionerRole)\r",
													""
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId_EmergencyRoom}}",
											"protocol": "https",
											"host": [
												"pp",
												"cisz",
												"by"
											],
											"path": [
												"api",
												"fhir",
												"PractitionerRole"
											],
											"query": [
												{
													"key": "practitioner",
													"value": "{{PractitionerId_EmergencyRoom}}"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "Достать структурное подразделение врача (LocationId_EmergencyRoom)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"let json = pm.response.json();\r",
													"let locationValue = null;\r",
													"\r",
													"if (Array.isArray(json.entry)) {\r",
													"    for (let entry of json.entry) {\r",
													"        if (\r",
													"            entry.resource &&\r",
													"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
													"            Array.isArray(entry.resource.location) &&\r",
													"            entry.resource.location.length > 0\r",
													"        ) {\r",
													"            // Берём reference первого location и извлекаем только UUID\r",
													"            let ref = entry.resource.location[0].reference;\r",
													"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
													"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
													"            }\r",
													"            break;\r",
													"        }\r",
													"    }\r",
													"}\r",
													"\r",
													"if (locationValue) {\r",
													"    pm.environment.set(\"LocationId_EmergencyRoom\", locationValue);\r",
													"    console.log(\"location сохранён:\", locationValue);\r",
													"} else {\r",
													"    console.log(\"location не найден\");\r",
													"}\r",
													""
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole_EmergencyRoom}}",
											"protocol": "https",
											"host": [
												"pp",
												"cisz",
												"by"
											],
											"path": [
												"api",
												"fhir",
												"PractitionerRole"
											],
											"query": [
												{
													"key": "_id",
													"value": "{{PractitionerRole_EmergencyRoom}}"
												}
											]
										}
									},
									"response": []
								}
							]
						},
						{
							"name": "Поиск пациента по идентификатору (patientId)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
											"\r",
											"pm.environment.set(\"patientId\", patientId);\r",
											"console.log(patientId)\r",
											""
										],
										"type": "text/javascript",
										"packages": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551227A009PB2",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient"
									],
									"query": [
										{
											"key": "identifier",
											"value": "7551227A009PB2"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск направления на госпитализацию (HospitalServiceRequest)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let servicerequestId = jsonData.entry.find(obj => obj.resource.resourceType === \"ServiceRequest\").resource.id;\r",
											"\r",
											"pm.environment.set(\"HospitalServiceRequest\", servicerequestId);\r",
											"console.log(servicerequestId)\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/ServiceRequest?_profile=https://fhir.by/StructureDefinition/ServiceRequestHospitalisation&_sort=-_lastUpdated&status=active",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"ServiceRequest"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/ServiceRequestHospitalisation"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "status",
											"value": "active"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск диагноза направившей организации (DiagnosisOfSendingOrganisation)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r",
											"\r",
											"pm.environment.set(\"DiagnosisOfSendingOrganisation\", conditionId);\r",
											"console.log(conditionId)"
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&patient={{patientId}}&_sort=-_lastUpdated&code=K35",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"Condition"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
										},
										{
											"key": "patient",
											"value": "{{patientId}}"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "code",
											"value": "K35"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Создание случая госпитализации",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
											"    pm.response.to.have.status(202);\r",
											"});\r",
											"\r",
											"var jsonData = pm.response.json();\r",
											"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
											"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
											"\r",
											"console.log(statusReference.valueReference.reference);\r",
											"\r",
											"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
											"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								},
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "POST",
								"header": [
									{
										"key": "X-Fhir-By-Version",
										"value": "active",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleUltrasound3.1\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3987\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-11-25T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionUltrasound3.1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionUltrasound3.1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-11-25T11:30:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId_EmergencyRoom}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisPreliminaryTest3\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"EpisodeOfCare/ExampleHospitalisationUrg1\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551227A009PB2\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 21.08.2021\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2022-08-21\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"version\": \"1.3\",\r\n                                                    \"code\": \"Minsk\",\r\n                                                    \"display\": \"Минск\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"version\": \"1.10\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP1233212\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375123456789\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.2\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.1201\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"EpisodeOfCare/ExampleHospitalisationUrg1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"EpisodeOfCare\",\r\n                \"id\": \"ExampleHospitalisationUrg1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/Hospitalisation\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaidType\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/HospitalisationPaidType\",\r\n                                            \"code\": \"govern\",\r\n                                            \"display\": \"за счет бюджетных средств\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaid\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EmergencyHospitalisationTerm\",\r\n                        \"valuePositiveInt\": 3\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HepatitisBool\",\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DiagnosisOfSendingOrganisation\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Condition/{{DiagnosisOfSendingOrganisation}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SequenceNumbeHospitalisation\",\r\n                        \"valuePositiveInt\": 1\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1245/1\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\",\r\n                                \"display\": \"Специализированная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/HospitalisationReasonUse\",\r\n                                    \"code\": \"2\",\r\n                                    \"display\": \"Экстренная госпитализация\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": [\r\n                            {\r\n                                \"concept\": {\r\n                                    \"text\": \"Для уточнения диагноза и лечения\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisPreliminaryTest3\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\",\r\n                                    \"display\": \"Предварительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"referralRequest\": [\r\n                    {\r\n                        \"reference\": \"ServiceRequest/{{HospitalServiceRequest}}\"\r\n                    }\r\n                ],\r\n                \"managingOrganization\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"period\": {\r\n                    \"start\": \"2025-11-25\"\r\n                },\r\n                \"careManager\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole_EmergencyRoom}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/AcuteAppendicitisPreliminaryTest3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"AcuteAppendicitisPreliminaryTest3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-11-25T10:12:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/CourseOfDisease\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/CourseOfDisease\",\r\n                                    \"code\": \"acute\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"K35\",\r\n                            \"display\": \"K35 - Острый аппендицит\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-11-25\",\r\n                \"recordedDate\": \"2025-11-25\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_EmergencyRoom}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Предварительный диагноз О. аппендицит ?\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Bundle",
										"$import"
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод получения статуса импорта пакета медицинской информации",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Bundle",
										"{{bundleId}}",
										"$status"
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод поиска случая Госпитализации",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/EpisodeOfCare?_profile=https://fhir.by/StructureDefinition/Hospitalisation&patient={{patientId}}&_sort=-_lastUpdated&status=active",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"EpisodeOfCare"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/Hospitalisation"
										},
										{
											"key": "patient",
											"value": "{{patientId}}"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "status",
											"value": "active"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Получение сводной информации о пациенте",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-09&end=2025-11",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"$everything"
									],
									"query": [
										{
											"key": "start",
											"value": "2025-09"
										},
										{
											"key": "end",
											"value": "2025-11"
										}
									]
								}
							},
							"response": []
						}
					]
				},
				{
					"name": "3.3 Выписка из стационара и импорт ультразвукового исследования, выполненного в процессе госпитализации",
					"item": [
						{
							"name": "Предварительные условия - авторизация врача-терапевта",
							"item": [
								{
									"name": "Получить новый токен и достать врача-терапевта (PractitionerId_therapist)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"const jwt = pm.request.auth?.oauth2?.get(\"accessToken\") || pm.request.auth?.bearer?.get(\"token\") || null;\r",
													"console.log(jwt);\r",
													"if (jwt) {\r",
													"    let payload = jwt.split('.')[1];\r",
													"    payload = payload.replace(/-/g, '+').replace(/_/g, '/');\r",
													"    while (payload.length % 4) payload += '=';\r",
													"    let decoded = JSON.parse(atob(payload));\r",
													"    console.log(decoded)\r",
													"    let practitionerId = decoded.practitioner_id || decoded.practitionerId || decoded[\"practitioner_id\"];\r",
													"    let organizationId = decoded.organization_id || decoded.organizationId || decoded[\"organization_id\"];\r",
													"    if (practitionerId) pm.environment.set(\"PractitionerId_therapist\", practitionerId);\r",
													"    if (organizationId) pm.environment.set(\"OrganizationId\", organizationId);\r",
													"} else {\r",
													"    console.log(\"JWT токен не найден в переменных коллекции\");\r",
													"}"
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"protocolProfileBehavior": {
										"disableBodyPruning": true
									},
									"request": {
										"method": "GET",
										"header": [
											{
												"key": "X-Fhir-By-Version",
												"value": "0.3.4934",
												"type": "text"
											}
										],
										"body": {
											"mode": "raw",
											"raw": ""
										},
										"url": {
											"raw": "https://postman-echo.com/get",
											"protocol": "https",
											"host": [
												"postman-echo",
												"com"
											],
											"path": [
												"get"
											]
										}
									},
									"response": []
								},
								{
									"name": "Достать PractitionerRole врача-терапевта (PractitionerRole_therapist)",
									"event": [
										{
											"listen": "test",
											"script": {
												"exec": [
													"var jsonData = pm.response.json();\r",
													"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
													"\r",
													"pm.environment.set(\"PractitionerRole_therapist\", practitionerRole);\r",
													"console.log(practitionerRole)\r",
													""
												],
												"type": "text/javascript",
												"packages": {},
												"requests": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId_therapist}}&position-type=therapist",
											"protocol": "https",
											"host": [
												"pp",
												"cisz",
												"by"
											],
											"path": [
												"api",
												"fhir",
												"PractitionerRole"
											],
											"query": [
												{
													"key": "practitioner",
													"value": "{{PractitionerId_therapist}}"
												},
												{
													"key": "position-type",
													"value": "therapist"
												}
											]
										}
									},
									"response": []
								}
							]
						},
						{
							"name": "Поиск пациента по идентификатору (patientId)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
											"\r",
											"pm.environment.set(\"patientId\", patientId);\r",
											"console.log(patientId)\r",
											""
										],
										"type": "text/javascript",
										"packages": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551227A009PB2",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient"
									],
									"query": [
										{
											"key": "identifier",
											"value": "7551227A009PB2"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод поиска активного случая Госпитализации (startEpisodeOfCare)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let episodeOfCaretId = jsonData.entry.find(obj => obj.resource.resourceType === \"EpisodeOfCare\").resource.id;\r",
											"\r",
											"pm.environment.set(\"startEpisodeOfCare\", episodeOfCaretId);\r",
											"console.log(episodeOfCaretId)"
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/EpisodeOfCare?_profile=https://fhir.by/StructureDefinition/Hospitalisation&patient={{patientId}}&_sort=-_lastUpdated&status=active",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"EpisodeOfCare"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/Hospitalisation"
										},
										{
											"key": "patient",
											"value": "{{patientId}}"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "status",
											"value": "active"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод поиска Предварительного диагноза (preliminaryConditionId)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r",
											"\r",
											"pm.environment.set(\"preliminaryConditionId\", conditionId);\r",
											"console.log(conditionId)"
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&patient={{patientId}}&_sort=-_lastUpdated&code=K35",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"Condition"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
										},
										{
											"key": "patient",
											"value": "{{patientId}}"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "code",
											"value": "K35"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск врача ультразвуковой диагностики (PractitionerRole_diagnostic)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"var jsonData = pm.response.json();\r",
											"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
											"\r",
											"pm.environment.set(\"PractitionerRole_diagnostic\", practitionerRole);\r",
											"console.log(practitionerRole)\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								},
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?organization={{OrganizationId}}&position-type=ultrasound-diagnostics-doctor",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"PractitionerRole"
									],
									"query": [
										{
											"key": "organization",
											"value": "{{OrganizationId}}"
										},
										{
											"key": "position-type",
											"value": "ultrasound-diagnostics-doctor"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Достать структурное подразделение врача (LocationId_diagnostic)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"let json = pm.response.json();\r",
											"let locationValue = null;\r",
											"\r",
											"if (Array.isArray(json.entry)) {\r",
											"    for (let entry of json.entry) {\r",
											"        if (\r",
											"            entry.resource &&\r",
											"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
											"            Array.isArray(entry.resource.location) &&\r",
											"            entry.resource.location.length > 0\r",
											"        ) {\r",
											"            // Берём reference первого location и извлекаем только UUID\r",
											"            let ref = entry.resource.location[0].reference;\r",
											"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
											"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
											"            }\r",
											"            break;\r",
											"        }\r",
											"    }\r",
											"}\r",
											"\r",
											"if (locationValue) {\r",
											"    pm.environment.set(\"LocationId_diagnostic\", locationValue);\r",
											"    console.log(\"location сохранён:\", locationValue);\r",
											"} else {\r",
											"    console.log(\"location не найден\");\r",
											"}\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole_diagnostic}}",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"PractitionerRole"
									],
									"query": [
										{
											"key": "_id",
											"value": "{{PractitionerRole_diagnostic}}"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод импорта пакета медицинской информации (подписывает врач-терапевт, т.к. идет выписка из стационара)",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
											"    pm.response.to.have.status(202);\r",
											"});\r",
											"\r",
											"var jsonData = pm.response.json();\r",
											"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
											"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
											"\r",
											"console.log(statusReference.valueReference.reference);\r",
											"\r",
											"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
											"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								},
								{
									"listen": "prerequest",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "POST",
								"header": [
									{
										"key": "X-Fhir-By-Version",
										"value": "active",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleUltrasound3.2\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3987\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-11-26T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionUltrasound3.2\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionUltrasound3.2\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-11-26T11:30:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId_therapist}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"EpisodeOfCare/ExampleHospitalisationUrg1\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisClinicalTest3\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisFinalTest3\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Observation/ExampleUltrasoundObs\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"DiagnosticReport/ExampleDiagnosticReportDR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ServiceRequest/ExampleSRBundleUS3\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551227A009PB2\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 21.08.2021\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2022-08-21\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"version\": \"1.3\",\r\n                                                    \"code\": \"Minsk\",\r\n                                                    \"display\": \"Минск\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"version\": \"1.10\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP1233212\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375123456789\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.2\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"517030229743858774\",\r\n                                            \"display\": \"Минск, г. Минск, Улица Уручская, д. 23 к.1201\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г. Минск, Улица Уручская\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"EpisodeOfCare/ExampleHospitalisationUrg1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"EpisodeOfCare\",\r\n                \"id\": \"ExampleHospitalisationUrg1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/Hospitalisation\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaidType\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/HospitalisationPaidType\",\r\n                                            \"code\": \"govern\",\r\n                                            \"display\": \"за счет бюджетных средств\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaid\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EmergencyHospitalisationTerm\",\r\n                        \"valuePositiveInt\": 3\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HepatitisBool\",\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DiagnosisOfSendingOrganisation\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Condition/{{DiagnosisOfSendingOrganisation}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SequenceNumbeHospitalisation\",\r\n                        \"valuePositiveInt\": 1\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PreviusResourceHospitalisation\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"EpisodeOfCare/{{startEpisodeOfCare}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1245/1\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"waitlist\",\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\",\r\n                                \"display\": \"Специализированная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/HospitalisationReasonUse\",\r\n                                    \"code\": \"2\",\r\n                                    \"display\": \"Экстренная госпитализация\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": [\r\n                            {\r\n                                \"concept\": {\r\n                                    \"text\": \"Для уточнения диагноза и лечения\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/{{preliminaryConditionId}}\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\",\r\n                                    \"display\": \"Предварительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisClinicalTest3\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Clinical\",\r\n                                    \"display\": \"Клинический диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/AcuteAppendicitisFinalTest3\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Final\",\r\n                                    \"display\": \"Заключительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"referralRequest\": [\r\n                    {\r\n                        \"reference\": \"ServiceRequest/{{HospitalServiceRequest}}\"\r\n                    }\r\n                ],\r\n                \"managingOrganization\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"period\": {\r\n                    \"start\": \"2025-11-25\",\r\n                    \"end\": \"2025-11-26\"\r\n                },\r\n                \"careManager\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole_EmergencyRoom}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/AcuteAppendicitisClinicalTest3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"AcuteAppendicitisClinicalTest3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Clinical\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-11-25T10:12:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/CourseOfDisease\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/CourseOfDisease\",\r\n                                    \"code\": \"acute\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"K35.3\",\r\n                            \"display\": \"K35.3 - Острый аппендицит с ограниченным перитонитом\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-11-25\",\r\n                \"recordedDate\": \"2025-11-25\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_therapist}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Клинический диагноз. Острый флегмонозный аппендицин. Местный серозно-фибринозный перитонит.\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/AcuteAppendicitisFinalTest3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"AcuteAppendicitisFinalTest3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Final\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-11-26T10:12:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/CourseOfDisease\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/CourseOfDisease\",\r\n                                    \"code\": \"acute\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"K35.3\",\r\n                            \"display\": \"K35.3 - Острый аппендицит с ограниченным перитонитом\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-11-26\",\r\n                \"recordedDate\": \"2025-11-26\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_therapist}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Острый флегмонозный аппендицин. Местный серозно-фибринозный перитонит.\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Observation/ExampleUltrasoundObs\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Observation\",\r\n                \"id\": \"ExampleUltrasoundObs\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ObservationUltrasound\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/UltrasoundProtocolDescription\",\r\n                        \"valueString\": \"Тонкий кишечник: Стенка тонкой кишки не утолщена, структура слоистая, перистальтика сохранена. Просвет равномерный, жидкости в просвете немного, патологических образований не выявлено.\\n   Толстый кишечник: Слепая кишка визуализируется, стенка утолщена до 8 мм, с потерей нормальной слоистой структуры. Аппендикс увеличен, диаметр 9 мм, стенка гипоэхогенна, с утолщением и жидкостным окружением (периаппендикулярная жидкость).\\n  В прилежащей клетчатке определяется гиперэхогенный инфильтрат, характерный для воспаления. Просвет остальных отделов толстой кишки без особенностей.\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Location/{{LocationId_diagnostic}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HospitalisationReference\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"EpisodeOfCare/{{startEpisodeOfCare}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"2025-002\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"final\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"03/2\",\r\n                                \"display\": \"Стационарная медицинская диагностика для взрослого населения\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/UltrasoundTypes\",\r\n                            \"code\": \"A04-18-001-001-add\",\r\n                            \"display\": \"УЗИ тонкого и толстого кишечника\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"effectivePeriod\": {\r\n                    \"start\": \"2025-11-25T12:05:00Z\",\r\n                    \"end\": \"2025-11-25T12:15:00Z\"\r\n                },\r\n                \"issued\": \"2025-11-25T12:20:00Z\",\r\n                \"performer\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PerformerTypeObservation\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/PerformerType\",\r\n                                            \"code\": \"organization-per\",\r\n                                            \"display\": \"организация\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PerformerTypeObservation\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/PerformerType\",\r\n                                            \"code\": \"practitionerRole-per\",\r\n                                            \"display\": \"роль медработника\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRole_diagnostic}}\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"DiagnosticReport/ExampleDiagnosticReportDR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"DiagnosticReport\",\r\n                \"id\": \"ExampleDiagnosticReportDR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/UltrasoundDiagnosticReport\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Location/{{LocationId_diagnostic}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RecomendationForFuncDiagConclusion\",\r\n                        \"valueString\": \"Рекомендуется консультация хирурга\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExaminationPriority\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ExaminationPriority\",\r\n                                    \"code\": \"urgent\",\r\n                                    \"display\": \"экстренно\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"2025-002\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"final\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"03/2\",\r\n                                \"display\": \"Стационарная медицинская диагностика для взрослого населения\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/UltrasoundTypes\",\r\n                            \"code\": \"A04-18-001-001-add\",\r\n                            \"display\": \"УЗИ тонкого и толстого кишечника\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"effectivePeriod\": {\r\n                    \"start\": \"2025-11-25T12:20:00Z\",\r\n                    \"end\": \"2025-11-25T12:20:00Z\"\r\n                },\r\n                \"issued\": \"2025-11-25T12:20:00Z\",\r\n                \"performer\": [\r\n                    {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                ],\r\n                \"resultsInterpreter\": [\r\n                    {\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRole_diagnostic}}\"\r\n                    }\r\n                ],\r\n                \"result\": [\r\n                    {\r\n                        \"reference\": \"Observation/ExampleUltrasoundObs\"\r\n                    }\r\n                ],\r\n                \"conclusion\": \"УЗ-признаки острого аппендицита: увеличенный, гипоэхогенный аппендикс с периаппендикулярным инфильтратом. Тонкий кишечник патологий не выявлено\"\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ServiceRequest/ExampleSRBundleUS3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ServiceRequest\",\r\n                \"id\": \"ExampleSRBundleUS3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ServiceRequestUltrasound\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SpecialtyCode\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ServiceSpecialtyBy\",\r\n                                    \"code\": \"C056\",\r\n                                    \"display\": \"Ультразвуковая диагностика\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequestFromOrganization\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"A0134\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"directive\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/HealthcareServiceCategory\",\r\n                                \"code\": \"03/1\",\r\n                                \"display\": \"Амбулаторно-поликлиническая диагностика для взрослого населения\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": \"routine\",\r\n                \"code\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSHealthcareServiceTypeBUltrasound\",\r\n                                \"code\": \"B01-049-002.vs\",\r\n                                \"display\": \"Прием (осмотр, консультация) врача ультразвуковой диагностики повторный\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"orderDetail\": [\r\n                    {\r\n                        \"parameter\": [\r\n                            {\r\n                                \"code\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/UltrasoundTypes\",\r\n                                            \"code\": \"A04-18-001-001-add\",\r\n                                            \"display\": \"УЗИ тонкого и толстого кишечника\"\r\n                                        }\r\n                                    ]\r\n                                },\r\n                                \"valueString\": \"Ограничений для проведения исследования нет\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"occurrenceDateTime\": \"2025-11-26T13:00:00Z\",\r\n                \"authoredOn\": \"2025-11-26T13:00:00Z\",\r\n                \"requester\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole_therapist}}\"\r\n                },\r\n                \"performer\": [\r\n                    {\r\n                        \"reference\": \"Organization/70bf8425-1ad6-44a7-9daf-019e52454876\"\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"Location/de6f845c-e4a5-46f9-bec5-cd1dddecf1d3\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"concept\": {\r\n                            \"text\": \"Для оценки состояния тонкого и толстого кишечника и исключения патологии\"\r\n                        },\r\n                        \"reference\": {\r\n                            \"reference\": \"Condition/AcuteAppendicitisFinalTest3\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Контроль УЗИ тонкого и толстого кишечника через 3 месяца\"\r\n                    }\r\n                ],\r\n                \"patientInstruction\": [\r\n                    {\r\n                        \"instructionMarkdown\": \"Воздержаться от приема пищи за 6-8 часов до проведения УЗИ, исключить из рациона жирные и жареные блюда\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Bundle",
										"$import"
									]
								}
							},
							"response": []
						},
						{
							"name": "Метод получения статуса импорта пакета медицинской информации",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Bundle",
										"{{bundleId}}",
										"$status"
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск направления на УЗИ",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/ServiceRequest?_profile=https://fhir.by/StructureDefinition/ServiceRequestUltrasound&_sort=-_lastUpdated",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"ServiceRequest"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/ServiceRequestUltrasound"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск исследования пациента по УЗИ",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"protocolProfileBehavior": {
								"disableBodyPruning": true
							},
							"request": {
								"method": "GET",
								"header": [],
								"body": {
									"mode": "raw",
									"raw": ""
								},
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Observation?_profile=https://fhir.by/StructureDefinition/ObservationUltrasound&_sort=-_lastUpdated&patient={{patientId}}",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"Observation"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/ObservationUltrasound"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										},
										{
											"key": "patient",
											"value": "{{patientId}}"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Поиск заключения по УЗИ",
							"event": [
								{
									"listen": "test",
									"script": {
										"exec": [
											""
										],
										"type": "text/javascript",
										"packages": {},
										"requests": {}
									}
								}
							],
							"protocolProfileBehavior": {
								"disableBodyPruning": true
							},
							"request": {
								"method": "GET",
								"header": [],
								"body": {
									"mode": "raw",
									"raw": ""
								},
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DiagnosticReport?_profile=https://fhir.by/StructureDefinition/UltrasoundDiagnosticReport&patient={{patientId}}&_sort=-_lastUpdated",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"DiagnosticReport"
									],
									"query": [
										{
											"key": "_profile",
											"value": "https://fhir.by/StructureDefinition/UltrasoundDiagnosticReport"
										},
										{
											"key": "patient",
											"value": "{{patientId}}"
										},
										{
											"key": "_sort",
											"value": "-_lastUpdated"
										}
									]
								}
							},
							"response": []
						},
						{
							"name": "Получение сводной информации о пациенте",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-08&end=2025-10",
									"protocol": "https",
									"host": [
										"pp",
										"cisz",
										"by"
									],
									"path": [
										"api",
										"fhir",
										"Patient",
										"{{patientId}}",
										"$everything"
									],
									"query": [
										{
											"key": "start",
											"value": "2025-08"
										},
										{
											"key": "end",
											"value": "2025-10"
										}
									]
								}
							},
							"response": []
						}
					],
					"description": "1. Выписка из стационара\n    \n2. Передача информации об ультразвуковом исследовании, выполненном в процессе госпитализации\n    \n3. Создание нового направление на УЗИ"
				}
			]
		},
		{
			"name": "Отмена импорта медицинской информации",
			"item": [
				{
					"name": "Отмена импорта медицинской информации",
					"request": {
						"method": "POST",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$cancel",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$cancel"
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				}
			]
		}
	],
	"auth": {
		"type": "oauth2",
		"oauth2": [
			{
				"key": "useBrowser",
				"value": true,
				"type": "boolean"
			},
			{
				"key": "redirect_uri",
				"value": "https://oauth.pstmn.io/v1/callback",
				"type": "string"
			},
			{
				"key": "clientId",
				"value": "mis_agsr_web_application",
				"type": "string"
			},
			{
				"key": "tokenRequestParams",
				"value": [
					{
						"key": "origin",
						"value": "https://oauth.pstmn.io/v1/callback",
						"enabled": true,
						"send_as": "request_header"
					}
				],
				"type": "any"
			},
			{
				"key": "scope",
				"value": "profile email acr realm roles",
				"type": "string"
			},
			{
				"key": "accessTokenUrl",
				"value": "https://pp.cisz.by/auth/api/realms/iehr/token",
				"type": "string"
			},
			{
				"key": "authUrl",
				"value": "https://pp.cisz.by/auth/api/realms/iehr/auth",
				"type": "string"
			},
			{
				"key": "clientSecret",
				"value": "",
				"type": "string"
			},
			{
				"key": "grant_type",
				"value": "authorization_code_with_pkce",
				"type": "string"
			},
			{
				"key": "refreshRequestParams",
				"value": [],
				"type": "any"
			},
			{
				"key": "authRequestParams",
				"value": [],
				"type": "any"
			},
			{
				"key": "challengeAlgorithm",
				"value": "S256",
				"type": "string"
			},
			{
				"key": "addTokenTo",
				"value": "header",
				"type": "string"
			},
			{
				"key": "client_authentication",
				"value": "body",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "practitioner_id",
			"value": ""
		},
		{
			"key": "organization_id",
			"value": ""
		},
		{
			"key": "locationId",
			"value": ""
		},
		{
			"key": "patientId",
			"value": ""
		},
		{
			"key": "bundleId",
			"value": ""
		},
		{
			"key": "StatusUrl",
			"value": ""
		}
	]
}